package beautiful.butterfly.drds.datasource.connection_contexts.mock;


import beautiful.butterfly.drds.datasource.connection_contexts.api.*;

public class Test {
    public static void main(String[] args) throws Exception {
        ConnectionContextsFactory connectionContextsFactory = new ConnectionContextsFactory();

        IConnectionContexts connectionContexts = connectionContextsFactory.createConnectionContexts(AbstractConnectionContextsFactory.getProperties());


        for (int i = 0; i < 2; i++) {
            IConnectionContext connectionContext = connectionContexts.getConnectionContext();
            IRowDataMapList rowDataMapList = connectionContext.createSql().executeQuery("select 1");
            rowDataMapList.next();
            System.out.println(rowDataMapList.getObject(1));
            rowDataMapList.close();
            IParameterizedISql parameterizedISql = connectionContext.createParameterizedSql("select 1");
            rowDataMapList = parameterizedISql.executeQuery();
            rowDataMapList.next();
            System.out.println(rowDataMapList.getObject(1));
            connectionContext.close();
        }
    }
}
